package Commands;

import domain.Controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class CmdLogin extends Command
{
  protected String nextJspUrl = 
    "elevLogin.jsp"; 
  CommandFactory comFac;
  Controller controller;

  public void init(CommandFactory comFac, Controller c)
    throws ServletException 
  {
    this.comFac = comFac;
    this.controller = c;
  }

  public void execute(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException 
  {
    HttpSession session = req.getSession();
    
    
    String ref = req.getParameter("ref");
    session.setAttribute("refpage",ref);
  }
  
  public String getNextJspUrl()
  {
    return nextJspUrl;
  }
}